'use strict';

import React, {Component, PropTypes} from 'react';

export default class Card extends Component {
	/*
	 * 构造函数。
	 * @param props 只读属性
	 */
	constructor(props) {
		super(props);
		this.state = {};
	}

	/*
	 * 渲染视图。
	 */
	render() {
		return (
			<div
				className="am-padding-vertical div"
				style={{
					backgroundColor: this.props.bgColor,
					borderRadius: 10,
				}}
			>
				<p
					className="am-padding-horizontal am-text-lg am-padding-bottom"
					style={{
						color: '#ffffff',
						lineHeight: '40px',
					}}
				>{this.props.children}</p>
				<p
					className="am-text-xxxl am-padding-horizontal"
					style={{
						backgroundColor: this.props.titleBgColor,
						color: '#ffffff',
						fontWeight: 'bold'
					}}
				>
					{this.props.bigTitle}
					<span className="am-text-lg">{this.props.smallTitle}</span>
				</p>
			</div>
		);
	}
}

Card.propTypes = {
	bigTitle: PropTypes.string,
	smallTitle: PropTypes.string,
	bgColor: PropTypes.string,
	titleBgColor: PropTypes.string
};
Card.defaultProps = {
	bigTitle: '',
	smallTitle: '',
	bgColor: '',
	titleBgColor: ''
};
